import { Box, Container } from "@chakra-ui/react";
import NodeCard from "./render/NodeCard";
import IOTitle from "./components/IOTitle";
import { Handle, Position } from "reactflow";
import RenderInput from "./render/RenderInput";
import { useContext } from "react";
import { WorkflowContext } from "@/context/WorkflowContext";

const NodeAnswer = ({ data, selected }: any) => {
  const { nodeId, outputs, inputs } = data;
  const { splitToolInputs } = useContext(WorkflowContext);
  const { isTool, commonInputs } = splitToolInputs(inputs, nodeId);
  console.log("NodeAnswer", commonInputs,data);
  return (
    <NodeCard minW={"400px"} selected={selected} {...data}    menuForbid={{
      rename: false,
      copy: false,
      delete: false}}>
      <Box
        px={4}
        mx={2}
        mb={2}
        py={"10px"}
        position={"relative"}
        bg={"myGray.50"}
        border={"1px solid #F0F1F6"}
        borderRadius={"md"}
      >
        <RenderInput nodeId={nodeId} flowInputList={commonInputs} />
      </Box>
    </NodeCard>
  );
};

export default NodeAnswer;
